#ifndef BARRIER_H
#define BARRIER_H

#include "sprites.h"
#include "collisions.h"

namespace sprites
{
	class Barrier : public Sprite
	{
		Brick ***blocks;
		int blockRows;
		int blockCols;
	private:
		void initBlocksArray();
		void killBlocks();
	public:
		Barrier(Vector3D _pos, MatterType _type, float _boundRadius);
		Barrier(Vector3D _pos, MatterType _type, float _boundRadius, float scale);
		~Barrier();

		//construct the barrier's shape
		void build();

		//collision testing
		virtual BindingSphere getBindingSphere();
		virtual std::vector<BindingSphere> getBindingShapes();
		
		virtual void handleCollision(MatterType type, BindingSphere sphere);

		//animation
		virtual void draw();

		void reset();

		//destroys a brick hit by a bullet and it's neighbors
		void destroyBricks(BindingSphere sphere);
	};
}


#endif